import 'package:flutter/material.dart';
import 'package:kmxy_base/datetime_select/datetime_select_view.dart';

class DatetimeSelectFactory {
  static datetimeSelectFactory(
    BuildContext context, {
    String? title,
    required List<DatetimeMode> datetimeModeList,
    DateTime? maxTime,
    DateTime? minTime,
    DateTime? currentTime,
    required DatetimeSelectFun onTime,
  }) {
    showModalBottomSheet(
        context: context,
        useSafeArea: true,
        isScrollControlled:
            true, // 将 isScrollControlled 设置为 true，此时弹窗最大高度为屏幕高度；
        builder: (builder) {
          return DatetimeSelectView(
            datetimeModeList: datetimeModeList,
            title: title,
            maxTime: maxTime,
            minTime: minTime,
            currentTime: currentTime,
            onTime: onTime,
          );
        });
  }
}
